

package role





//getRoleInfoListCount 获取角色信息列表条数
const getRoleInfoListCount = `
select 
	count(1)
from sso_role_info t
where
	?t.name
	&t.status
	and t.create_time >=  if(@start_create_time='', t.create_time,@start_create_time)
	and t.create_time <  date_add(if(@end_create_time='',t.create_time,@end_create_time), interval 1 day)`


	
//getRoleInfoList 查询角色信息列表数据
const getRoleInfoList = `
select
	t.role_id,
	t.name,
	t.status,
	t.create_time,
	1
from sso_role_info t
where
	?t.name
	&t.status
	and t.create_time >=  if(@start_create_time='', t.create_time,@start_create_time)
	and t.create_time <  date_add(if(@end_create_time='',t.create_time,@end_create_time), interval 1 day)
order by 
	t.role_id desc
limit @ps offset @offset`

// insertRoleInfo 保存角色信息数据
const insertRoleInfo = `
insert into sso_role_info
(
	name,
	status
	)
values
(
	@name,
	@status
	)`

//updateRoleInfo 修改角色信息数据
const updateRoleInfo = `
update sso_role_info t set
	t.name = @name,
	t.status = @status
where
	&role_id`

//getRoleInfo 查询单条角色信息数据
const getRoleInfo = `
select
	t.role_id,
	t.name,
	t.status,
	t.create_time
from sso_role_info t
where
	&role_id`


//deleteRoleInfo 删除单条角色信息数据
const deleteRoleInfo = `
delete from sso_role_info
where
	&role_id`